package com.xiang.mall.framework.core.config

import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.http.client.OkHttp3ClientHttpRequestFactory
import org.springframework.web.client.RestTemplate

/**
 * @author xiangliyou
 * @email xiangliyou1814@mail.yneusoft.com
 * @date 2019-03-06 15:12
 *
 */
@Configuration
class RestConfig {

    /**
     * 配置 restTemplate使用okHttp3
     */
    @Bean
    fun okHttp3RestTemplate(): RestTemplate {
        return RestTemplate(OkHttp3ClientHttpRequestFactory())
    }
}
